/*
 * RTCC1.h
 *
 *  Created on: 19/12/2012
 *      Author: RIchard
 */

#ifndef RTCC1_H_
#define RTCC1_H_

#include "../DIO/DIOC1.h"

typedef struct
{
   uint8 u8Seconds;
   uint8 u8Minutes;
   uint8 u8Hours;
} RTC_tstTime;

typedef struct
{
   uint8  u8DayOfWeek;
   uint8  u8DayOfMonth;
   uint8  u8Month;
   uint16 u16Year;
} RTC_tstDate;

typedef enum
{
   RTC_nCalendarEvent_MinuteChange  = 0u,
   RTC_nCalendarEvent_HourChange    = 1u,
   RTC_nCalendarEvent_Noon          = 2u,
   RTC_nCalendarEvent_Midnight      = 3u
} RTC_tenCalendarEvent;

void RTC_vReset( void );
void RTC_vSetTime( RTC_tstTime const * stTime );
void RTC_vSetDate( RTC_tstDate const * stDate );
void RTC_vGetTime( void (*pfGetRTCCallback)(RTC_tstTime *stTime) );
void RTC_vSetCalendarEvent( RTC_tenCalendarEvent enCalendarEvent );
void RTC_vEnableInterrupt( uint8 u8InterruptMask );

#endif /* RTCC1_H_ */
